package cn.wolfcode.wolf2w.cloud.member.exception;

import cn.wolfode.wolf2w.cloud.commom.exception.BusinessException;
import cn.wolfode.wolf2w.cloud.commom.exception.CommExceptionAdvice;
import cn.wolfode.wolf2w.cloud.commom.util.JsonResult;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

//针对member-server服务统一异常处理
@ControllerAdvice
public class MemberCommExceptionAdvice extends CommExceptionAdvice {

    //针对member-server服务所以异常做统一异常处理
    //老爸写了这里不用写
    /*@ExceptionHandler(BusinessException.class)
    @ResponseBody
    public JsonResult handler(BusinessException e) {
        e.printStackTrace();
        return new JsonResult(e.getCodeMsg(), null);
    }*/

    /*@ExceptionHandler(Exception.class)
    @ResponseBody
    public JsonResult handlerDefaultException(Exception e){
        e.printStackTrace();
        return new JsonResult(MemberCodeMsg.DEDULT_ERROR,null);
    }*/
}
